/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package projectjava;

import com.ihm.*;
import java.sql.*;
import javax.swing.JOptionPane;


/**
 *
 * @author sylverster
 */
public class ProjectJava {

    private static Connection connection = null;
    
    public static void main(String[] args) 
    {
    
        String url = "jdbc:mysql://localhost:3306/minisig";
        String login = "root";
        String password = "root";

        // Connexion à la base de données
        try 
        {
               connection = DriverManager.getConnection(url,login,password);
               if(!connection.isClosed())
               {
                    Index fenetre = new Index();
               }
  
        }
        catch (SQLException e) 
        {
               JOptionPane.showMessageDialog(null,"Impossible de se connecter à la base de données"); 
        }
        
        try 
        {
                if(!connection.isClosed())
                {
                    connection.close();
                    System.out.println("Fermeture de la base de données");
                }
        }
       catch (SQLException e)
       {
                e.printStackTrace();
       }
        
    }
    
}
